#!/usr/bin/perl
use Cwd;
use locale;
my $file1 = "test.tst";
my $file2 = "test-tagged.txt";
my $file3 = "differece-tags.txt";
my $testdatafile;
my $taggeroutputfile;
open TestData, $file1;
while(<TestData>)
{
    $testdatafile .=$_ ;
}
close TestData;

open TaggerData,$file2;
while(<TaggerData>) 
{
    $taggeroutputfile .=$_;
}
close TaggerData;

my @testdatasplit;
my @taggeroutputsplit;
my @testtag;
my @taggertag;

@testdatasplit = split(/[\n]+/,$testdatafile);
@taggeroutputsplit = split(/[\n]+/,$taggeroutputfile);

my $acc=0;
my $len = $#testdatasplit;
open DIFF,">",$file3;

for (my $i =0; $i<$len; $i++)
{
	@testtag = split(/\//,$testdatasplit[$i]);
	@taggertag = split(/\//,$taggeroutputsplit[$i]);
       	if($testtag[1] eq $taggertag[1])
	{
        	$acc +=1;
    	}
	else
	{
		print  DIFF $testtag[0]," ",$testtag[1], "  ", $taggeroutputsplit[0]," ",$taggeroutputsplit[1];
		print DIFF "\n";
	}
}
close DIFF;
print $acc/($len-1);

